/**
 * Created by jaliu on 2015/2/13.
 */

/**
 * Define routes/RESTServices for users namespace
 * Version: v1.0
 */

//401: failed
//200: OK

module.exports = function (app) {
    var users = require('../../controllers/backoffice/backOffice-user-controller');
    logger.debug("load the backOffice-frontendUser-route module....");

    //获取小区列表
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/getAllCommunity', users.getAllCommunity);

    //搜索前端用户
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/searchFrontendUser/:communityObjId/:mobilePhone/:nickName/:isVUser/:isTalent/:startDate/:endDate/:startPage/:pageSize',users.searchFrontendUser);

    //拉黑前端用户
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/putFrontendUserToBlackList/:userObjId',users.putFrontendUserToBlacklist);

    //查询是否为认证用户
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/getUserAuthenticationInfo/:communityObjId',users.getUserAuthenticationInfo);

    //设置/取消VUser
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/user/setCancelVUser/:userObjId/:communityObjId',users.setCancelVUser);
    //修改用户信息
    app.put('/rest/' + RESTFullServiceVersion + '/backoffice/user/updateUser/:userObjId', users.updateUser);

    //设置前端用户为达人
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/user/setCancelFrontendUserToTalent/:userObjId/:talentDesc/:type',users.setCancelFrontendUserAsTalent);

};
